package com.bwie.controller;

import com.bwie.entity.Bargain;
import com.bwie.service.BargainService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 高洋
 * @Classname BargainController
 * @Description
 * @Date 2022/7/7 10:21
 */
@Controller
public class BargainController {

    @Autowired
    private BargainService bargainService;



    @RequestMapping("/list")
    public String list(Model model, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "2")Integer pageSize){
        PageInfo<Bargain> list = bargainService.list(pageNum,pageSize);
        model.addAttribute("list",list);
        return "list";
    }





}
